home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / soundhax.zip / PLAYD.C < prev    next >
C/C++ Source or Header  |  1991-12-19  |  2KB  |  94 lines

  1. /*-------------------------------------------------------*/
  2. /* Originally part of SOUNDHAX v1 by John M. Trindle     */
  3. /*                 FREEWARE 12/19/91                     */
  4. /*-------------------------------------------------------*/
  5.  
  6. #include <stdio.h>
  7.  
  8.  
  9. #define  CMS_AVAILABLE  1
  10. #define  FM_AVAILABLE   2
  11. #define  CV_AVAILABLE   4
  12.  
  13. #define  OFF            0
  14. #define  ON             1
  15.  
  16. #define  FALSE          0
  17. #define  TRUE           1
  18.  
  19. extern _ct_io_addx;
  20. extern _ct_int_num;
  21. extern _ct_music_status;
  22. extern _ct_voice_status;
  23.  
  24. static int StatusWord;
  25.  
  26. char *VoiceDriver;
  27.  
  28. /* Add'l functions:
  29.    _ctvd_pause() suspends sample play
  30.    _ctvd_continue() resumes the sample where it left off
  31. */
  32.  
  33. main(int argc, char *argv[])
  34. {
  35.    int DriverFeatures,VersionCode,RetVal,i;
  36.  
  37.    char buffer[255];
  38.    FILE *fp;
  39.  
  40.  
  41.    _ct_io_addx = 0x220;    /* I/O Base */
  42.  
  43.    DriverFeatures = _ct_card_here();
  44.  
  45.    if (DriverFeatures & CMS_AVAILABLE)
  46.       printf("C/MS Music Available\n");
  47.  
  48.    if (DriverFeatures & FM_AVAILABLE)
  49.       printf("FM Music Available\n");
  50.  
  51.    if (DriverFeatures & CV_AVAILABLE)
  52.       printf("Creative Voice Available\n");
  53.    else
  54.    {
  55.       printf("Sound Blaster or Compatible NOT detected\n");
  56.       exit(1);
  57.    }
  58.  
  59.    VersionCode = _sbc_version();
  60.  
  61.    printf("SBV Version = %d.%d\n",VersionCode >> 8, VersionCode & 0xff);
  62.  
  63.    _sbc_scan_int();
  64.  
  65.    printf("Interrupt = %d\n",_ct_int_num);
  66.  
  67.    fp = fopen(argv[1],"rb");
  68.  
  69.    if (fp == NULL)
  70.       printf("File %s not found\n",argv[1]);
  71.    else
  72.    {
  73.  
  74.       RetVal = _ctvd_init(6);
  75.       printf("RetVal = %d\n",RetVal);
  76.  
  77.       _ctvd_speaker(ON);
  78.  
  79.       _ctvd_output(fp->_file);
  80.  
  81.       while(_ct_voice_status)
  82.          if (kbhit())
  83.          {
  84.             if(!getch())
  85.                getch();
  86.             break;
  87.          }
  88.  
  89.       _ctvd_speaker(OFF);
  90.  
  91.       _ctvd_terminate();
  92.    }
  93. }
  94.